﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:primitives="clr-namespace:ESRI.ArcGIS.Client.Toolkit.Primitives"
	xmlns:local="clr-namespace:ESRI.ArcGIS.Client.Toolkit">

    <Style TargetType="local:TemplatePicker">
        <Setter Property="ItemTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid>
                        <Button Margin="2" Command="{Binding Editor.Add}" CommandParameter="{Binding TypeID}"                                                          
                                                         HorizontalContentAlignment="Center" >
                            <ToolTipService.ToolTip>
                                <StackPanel>
                                    <TextBlock FontWeight="Bold" Text="{Binding Name}" />
                                    <TextBlock Text="{Binding Description}" />
                                </StackPanel>
                            </ToolTipService.ToolTip>
                            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Vertical">
                                <primitives:SymbolDisplay Height="25" Width="30" Symbol="{Binding Symbol}"></primitives:SymbolDisplay>
                            </StackPanel>
                        </Button>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TemplatePicker">
                    <primitives:TemplatePanel Templates="{TemplateBinding Templates}" StackCount="2" StackDirection="Horizontal"
                                              ItemTemplate="{TemplateBinding ItemTemplate}" />
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>
